home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 162 < prev    next >
Internet Message Format  |  1996-08-06  |  2KB

  1. Path: tko.dec.com!diamond
  2. From: diamond@tko.dec.com (Norman Diamond)
  3. Newsgroups: comp.std.c
  4. Subject: Re: Double-character operators
  5. Date: 23 Jan 1996 05:24:50 GMT
  6. Organization: Digital Equipment Corporation Japan , Tokyo
  7. Message-ID: <4e1rf2$tju@usenet.pa.dec.com>
  8. References: <4e17uk$g3@kocrsv08.delcoelect.com>
  9. Reply-To: diamond@jrdv04.enet.dec-j.co.jp (Norman Diamond)
  10. NNTP-Posting-Host: jit533.tko.dec.com
  11.  
  12. In article <4e17uk$g3@kocrsv08.delcoelect.com>, c2xrfs@eng.delcoelect.com (Richard F. Smiley) writes:
  13. >Specifically, should the three-character sequence  "& ="  be
  14. >treated as representing the two-character operator  "&="?  
  15.  
  16. Assuming this is in the main C language (i.e. after preprocessing has been
  17. done, and not inside a string literal or anything), I think that any program
  18. containing the three-character sequence "& =" must have a syntax error.
  19. Every conforming implementation must issue a diagnostic.
  20.  
  21. >However, a compiler I respect instead treats this as a legal fragment
  22. >involving the "&=" operator.  Is that allowed?  (The program fragment
  23. >was caused by a bad macro definition.  If the compiler had complained,
  24. >we would have found the problem earlier.)
  25.  
  26. In addition to issuing a diagnostic, the implementation is free to do
  27. whatever else it likes, such as pretending it was the two-character
  28. operator "&=".  Furthermore, the diagnostic doesn't have to be accurate or
  29. meaningful.  If the implementation issues any diagnostic at all, for example
  30. a warning about some other part of the program, or a warning saying that
  31. the implementation doesn't try very hard, then it meets the requirement.
  32.  
  33. If the implementation issued no diagnostic at all about your program,
  34. and if you invoked the implementation according to the vendor's instructions
  35. for a conforming implementation, then I'd say you're entitled to a refund.
  36. In any case, you can consider not buying anything further from that vendor.
  37. The marketplace speaks louder than the standard, and on rare occasions
  38. quality speaks too.
  39. --
  40.  <<  If this were the company's opinion, I would not be allowed to post it.  >>
  41. "I paid money for this car, I pay taxes for vehicle registration and a driver's
  42. license, so I can drive in any lane I want, and no innocent victim gets to call
  43. the cops just 'cause the lane's not goin' the same direction as me" - J Spammer
  44.